const KoaRouter = require('@koa/router')

const {query,create,deleteById,update} = require('../controller/nav.js')

const {validateAuth} = require('../middleware/login.js')

const userRouter = new KoaRouter({prefix: '/nav'})

//中间件拦截http请求,中间件其实就是个函数
userRouter.post('/save',validateAuth,create)
userRouter.get('/list',query)
userRouter.delete('/delete',validateAuth,deleteById)
userRouter.patch('/update',validateAuth,update)

module.exports = userRouter
